import util from '../../../utils/util'
import { VideoDetail } from '../../../config/api'

Page({

  /**
   * 页面的初始数据
   */
  data: {
    model: '',
    id: '',
    detail: ''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let id = options.id;

    let model = wx.getStorageSync('model')
    this.setData({
      model
    });

    console.log(id)
    this.setData({
      id: id
    })
    this.getDetail();
  },

  getDetail() {
    let that = this;
    util.apiRequest(VideoDetail, { id: that.data.id }, null).then(r => {
      that.setData({
        detail: r.data.data
      })
    })
  }

})